package cn.aitrox.ry.service.config.api;

import cn.aitrox.ry.bean.CommonPageInfo;
import cn.aitrox.ry.bean.RespResult;
import cn.aitrox.ry.service.config.dto.CommonConfigDto;
import cn.aitrox.ry.service.config.dto.CommonConfigItemDto;
import cn.aitrox.ry.service.config.dto.in.CommonConfigChildAddInDto;
import cn.aitrox.ry.service.config.dto.in.CommonConfigChildEditInDto;
import cn.aitrox.ry.service.config.dto.in.CommonConfigNameExistInDto;
import cn.aitrox.ry.service.config.dto.in.CommonConfigSearchInDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface CommonConfigApi {

    @PostMapping(value = "/config/common/list")
    CommonConfigDto commonList(@RequestParam(value = "configList", required = false) List<String> configList);

    @GetMapping(value = "/config/common/maxCode")
    String maxCode(@RequestParam("codePrefix") String codePrefix);

    @PostMapping(value = "/config/common/child")
    RespResult childAdd(@RequestBody CommonConfigChildAddInDto input);

    @PostMapping(value = "/config/common/search")
    CommonPageInfo<CommonConfigItemDto> search(@RequestBody CommonConfigSearchInDto input);

    @PutMapping(value = "/config/common/child")
    RespResult childEdit(@RequestBody CommonConfigChildEditInDto input);

    @PostMapping(value = "/config/common/name/exist")
    Boolean nameExisted(@RequestBody CommonConfigNameExistInDto input);
}
